/**
 * 
 */
package com.gragra.sampling;
import com.gragra.structures.Structure;
/**
 * this interface contains some of the functions needed for population based sampling
 * @author Christoph Teichmann
 * created Feb 2, 2013 11:18:10 PM
 * @version 0.1
 */
public interface PopulationSamplingStructure extends Structure
{
	/**
	 * samples the assignment the structure contains for the given number of the thread or the element of the
	 * population, annealing is meant to be multiplied
	 * @param pa
	 * @param annealing
	 * @param thread
	 */
	void resample(PopulationProbabilityAssigner pa, double annealing, int thread,ThreadedUniformAccess tua);
	/**
	 * returns the best assignment seen so far as according to set best
	 * @param pa 
	 * @return
	 */
	String getBest(PopulationProbabilityAssigner pa);
	/**
	 * returns a string representation the minimum risk estimate resulting from sampling, only legal if
	 * addSample has been called at least once before, otherwise result is undefined
	 * @param pa 
	 * @return
	 */
	String minRisk(PopulationProbabilityAssigner pa);
	/**
	 * tells the structure that the current assignment of all parallel structures are to be added to the
	 * current sample
	 */
	void addSample();
	/**
	 * tells the structure that the current assignment number num is to be regarded as the best seen assignment
	 * @param num
	 */
	void setBest(int thread);
	/**
	 * initializes the assignments of the hidden variables with the given Assigner
	 * @param pa
	 */
	void initialize(PopulationProbabilityAssigner pa, ThreadedUniformAccess tua);
}